
<?php

class Application_Model_DomainobjectType extends Application_Model_DomainObject {

      protected $_id;
      protected $_name;
      protected $_className;

      /**
       * 代购
       */
      const ObjectType_Order = 1;

      /**
       *  退换货
       */
      const ObjectType_ReturnGoods = 2;

      /**
       * 前台支付
       */
      const ObjectType_Pay = 4;
      /**
       * 预报包裹
       */
      const ObjectType_Ing = 5;
      /**
       * 换货
       */
      const ObjectType_Exchange = 6;
      /**
       * 上门取件--存入云仓库
       */
      const ObjectType_Visiting = 7;
      /**
       * 上门取件--直发海外
       */
      const ObjectType_VisitingWay = 8;
      /**
       * 代购商品
       */
      const ObjectType_OrderItem = 11;
      /**
       * 出现问题
       */

      /**
       * 网购包裹
       */
      const ObjectType_Online = 12;

      /**
       * 网购单个商品
       */
      const ObjectType_Onlinesing = 13;
      const CK_Problem = 1;
      /**
       * 问题处理
       */
      const CK_Solve = 2;

      public static function getObjectItem($id) {
            return self::load($id);
      }

      public static function getTypeItem($type) {
            switch ($type) {
                  case self::ObjectType_Order:
                        return "purchase/buydetail/id/";
                        break;
                  case self::ObjectType_ReturnGoods:
                        return "returngoods/details/id/";
                        break;
                  default:
                        return "financial/index/";
                        break;
            }
      }
      /**
       * @return type 是否存在
       */
      public static function getIssetobjectId($objectType,$objectId){
            switch ($objectType){
                  case self::ObjectType_Order:
                        $result = Application_Model_Order::load($objectId);
                        if($result)
                        {
                              return true;
                        }else{
                              return false;
                        }
                        break;
                  case self::ObjectType_ReturnGoods:
                        $conse = Application_Model_ReturnGoods::load($objectId);
                        if($conse)
                        {
                              return true;
                        }else{
                              return false;
                        }
                        break;
                  default:
                        break;
            }
      }

}
